<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <input type="text" value="默认值">
  <input type="checkbox" name="" id="">
  <button>点击</button>

  <script>
    //获取元素
    const input = document.querySelector(`input`)
    // console.log(uname.value) // 默认
    // console.log(uname.innerHTML)  注意:innertHTML 得不到表单的内容
    //修改元素文本属性值
    input.value = `更新值`
    //修改成密文
    input.type = 'password'

    //获取第2个input,实现勾选
    const ipt = document.querySelector(`input:nth-child(2)`)
    ipt.checked = true // 默认false,修改为true

    //获取按钮
    const button = document.querySelector(`button`)
    button.disabled = true // 默认false,表示不禁用按钮,改为false
  </script>
</body>
</html>